<?php
/**
 * User's form
 *
 * @category    IPB_CMS
 * @package     Application_Module_Admin
 * @subpackage  Form
 * @copyright   Copyright (c) 2009 IPB CMS <http://ipb-cms.googlecode.com/>
 * @license     http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License
 * @author      Henrique Moody <henriquemoody@gmail.com>
 */
class Admin_Form_User extends App_Form
{

    /**
     * Initialize form
     *
     * @return void
     */
    public function init()
    {
        // Username field
        $this->addElement('text', 'userUsername', array(
            'label' => 'Username',
            'required' => true,
            'maxlength' => 45,
            'validators' => array(
                array('StringLength', array(8, 45)),
                array('Alpha', array(
                    'allowWhiteSpace' => false
                ))
            ),
            'filters' => array(
                'StringTrim'
            )
        ));
        // Password field
        $this->addElement('password', 'userPassword', array(
            'label' => 'Password',
            'required' => true,
            'maxlength' => 45,
            'validators' => array(
                array('StringLength', array(8, 45))
            )
        ));
        // Reply password field
        $this->addElement('password', 'reply_userPassword', array(
            'label' => 'Repeat password',
            'ignore' => true,
            'required' => true,
            'maxlength' => 45,
            'validators' => array(
                array('StringLength', array(8, 45))
            )
        ));
        // Nickname field
        $this->addElement('text', 'reply_userNickname', array(
            'label' => 'Nickname',
            'description' => 'This is the name that will be publicly',
            'required' => true,
            'maxlength' => 45,
            'validators' => array(
                array('StringLength', array(8, 45))
            )
        ));
        // Submit button
        $this->addElement('submit', $this->getName() . '_submit', array(
            'label' => 'Send',
            'ignore' => true
        ));
    }

}
